package graph_viewer.structure;

import java.awt.Point;

/**
 * add the setter&getter methods for x, y
 */

public class Fisheye_Point {
	private int x, y;
	
	//============================================================================
	// constructor
	//============================================================================
	public Fisheye_Point( int x, int y ){
		setX( x );
		setY( y );
	}
	
	public Fisheye_Point( double x, double y ){
		this( (int)x, (int)y );
	}
	
	public Fisheye_Point( int[] xy ){
		this( xy[0], xy[1] );
	}

	
	//============================================================================
	// public methods
	//============================================================================
	public Point convert_to_awt_point(){
		return new Point( getX(), getY() );
	}
	
	public boolean left_to_a_point( Fisheye_Point point ){
		return getX() < point.getX();
	}

	public boolean right_to_a_point( Fisheye_Point point ){
		return getX() > point.getX();
	}

	public boolean above_a_point( Fisheye_Point point ){
		return getY() < point.getY();
	}

	public boolean under_a_point( Fisheye_Point point ){
		return getY() > point.getY();
	}

	public String toString(){
		return "x: " + x + ", y:" + y;
	}
	//============================================================================
	// setter & getter
	//============================================================================	
	public void setX( int x ){
		this.x = x;
	}

	public int getX(){
		return this.x;
	}

	public void setY( int y ){
		this.y = y;
	}

	public int getY(){
		return this.y;
	}
}
